#include "insertionSort.h"
#include "contador.h"
#include<stdio.h>
#include<stdlib.h>

void insertionSort(int a[], int length, long cont[]) {
     int i, j, value;
     for(i = 1; i < length; ++i) {
         value = a[i];
         for (j = i - 1; j >= 0 && a[j] > value; --j,cont[0] = cont[0]+1){             
             cont[1]++;
             a[j + 1] = a[j];
             a[j] = value;
         }
     }
 }
